GtkBuilder: Fall back to gtk_test_register_all_types if type lookup fails
authorAlexander Larsson <alexl@redhat.com>
Mon, 14 Oct 2013 14:05:08 +0000 (16:05 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 16 Oct 2013 01:41:35 +0000 (21:41 -0400)
This is important because the dlsym() approach can fail if gtk was
loaded with RTLD_LOCAL.

https://bugzilla.gnome.org/show_bug.cgi?id=710096

gtk/gtkbuilder.c

index 38d71f1bd14b3d9825495c34f49701aaa2af3718..b76931e86813bdee4098624a1b8c6effd0cd7985 100644 (file)
 #include "gtktypebuiltins.h"
 #include "gtkwindow.h"
 #include "gtkicontheme.h"
+#include "gtktestutils.h"
 #include "deprecated/gtkstock.h"
 
 
@@ -455,7 +456,12 @@ gtk_builder_real_get_type_from_name (GtkBuilder  *builder,
   if (gtype != G_TYPE_INVALID)
     return gtype;
 
-  return _gtk_builder_resolve_type_lazily (type_name);
+  gtype = _gtk_builder_resolve_type_lazily (type_name);
+  if (gtype != G_TYPE_INVALID)
+    return gtype;
+
+  gtk_test_register_all_types ();
+  return g_type_from_name (type_name);
 }
 
 typedef struct